﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <script type="text/javascript">
        var integer = 5;                            //In binary this is 0101.
        var mask = 8;                          // 0001 << 3 = 1000bin = 8dec
        if (integer & mask == 0) {
            document.writeln("The third bit is 0.");
        }
        else {
            document.writeln("The third bit is 1.");
        }
        // Not working for some reason, don't know why.
    </script>
</body>
</html>
